package myicesscheduler.web;

import static org.junit.Assert.*;

import java.io.File;

import org.junit.BeforeClass;
import org.junit.Test;

public class MyFolderUtilTest
{
   private static final String delim = String.valueOf( File.separatorChar );

   @BeforeClass
   static public void beforeClass()
   {
      System.setProperty( MyFolderUtil.uploadFolder_folderPropertyName, "." + delim + "WebContent"
            + delim + "WEB-INF" + delim + "upload" );

      System.setProperty( MyFolderUtil.backupFolder_folderPropertyName, "." + delim + "WebContent"
            + delim + "WEB-INF" + delim + "backup" );
   }

   @Test
   public void getAbsolutePathOfFiles()
   {
      final String[] uploadFiles = MyFolderUtil.uploadFolder.getAbsolutePathOfFiles();
      assertNotNull( uploadFiles );
      assertTrue( uploadFiles[ 0 ].startsWith( delim ) );

      final String[] dbFiles = MyFolderUtil.databaseFolder.getAbsolutePathOfFiles();
      assertNotNull( dbFiles );
      assertTrue( dbFiles[ 0 ].startsWith( delim ) );
   }
}
